 <projecta charset="utf-8">

<div class="box " id="app_project_open_close">

              <div class="box-body ">
             	<p style="font-size: 1.5em;">
	             	<stong>项目名</stong>：{{pmpProject.name}}，
	             	&nbsp;&nbsp;&nbsp;&nbsp;<stong>创建时间</stong>： {{pmpProject.createtime}}，
	             	&nbsp;&nbsp;&nbsp;&nbsp;<stong>当前版本</stong>： {{pmpProject.versionName}}，
	             	&nbsp;&nbsp;&nbsp;&nbsp;<stong>项目负责人</stong>： {{pmpProject.pmUserName}}，
	             	<br>
	             	
	             	<stong>项目当前状态</stong>：<span class="label label-info">{{projstatus}}</span> 
             	</p>
              </div>
              
              <div class="box-footer">
             <h3> 项目关闭之后，无法再做任何修改，项目负责人或者公司管理人员可以重新开启项目。</h3>
                 <button type="button" class="btn btn-danger" v-on:click="doSet(4)">关闭项目</button>
                 <button type="button" class="btn btn-danger" v-on:click="doSet(3)">暂停项目</button>
                 <button type="button" class="btn btn-danger" v-on:click="doSet(-1)">删除项目</button>
                 <button type="button" class="btn btn-info "  v-on:click="doSet(1)">重新开启</button>
              </div>
</div>
<script type="text/javascript">
//#0未开始，1进行中，2结束，3暂停中，4关闭-1删除
new Vue({
        el: '#app_project_open_close',
        data:  {
        	projstatus: '',
        	pmpProject: {},
        	 projectId: detail_set.$data.projectId,
    	    bus:new Vue()
     }, 
     mounted: function(){
    	 var _this=this;
    	 _this.init();
     },
     methods: {
    	 init: function(){
    		 var _this=this;
      		 var ajaxUrl = "/pmp/service/pub/pmpProject/loadProject";
    			zfesAjax.ajaxTodo(ajaxUrl, { "id" : _this.$data.projectId}, function(data) {
    				_this.$data.pmpProject=data.data.project;
    				var s=_this.$data.pmpProject.status;
    				if(0==s){
    					_this.$data.projstatus='[未开始]';
    				}else if(1==s){
    					_this.$data.projstatus='[进行中]';
    				}else if(2==s){
    					_this.$data.projstatus='[结束]';
    				}else if(3==s){
    					_this.$data.projstatus='[暂停中]';
    				}else if(-1==s){
    					_this.$data.projstatus='[删除]';
    				}else if(4==s){
    					_this.$data.projstatus='[关闭]';
    				}
    			}); 
    	 },
        	 doSet: function (status) {
        		 var _this=this;
        			 alertSwal.confirm("确认","是否确认该项目",function(){
						    var ajaxUrl = "/pmp/service/ma/pmpProject/setPmpProjectStatus";
							zfesAjax.ajaxTodo(ajaxUrl, { "id" : _this.$data.projectId,"status":status}, function(data) {
								alertSwal.successText(data.message);
								_this.init();
							}); 
				});
        	    }
    }
})

 </script>
